#include "UIFooter.h"
#include "UICommon.h"
#include "../Global/ECGGlobal.h"
#include "../Global/ECGMessage.h"

#include <windows.h>

#pragma execution_character_set("utf-8")

UIFooter::UIFooter(QWidget *parent/* = 0*/)
	:QCWidget(parent)
{
	this->setProperty("UIClass", "Footer");

	m_pLabelCompany = new QLabel(this);
	m_pLabelCompany->setProperty("UIClass", "Label3");

	m_pLabelHotLine = new QLabel(this);
	m_pLabelHotLine->setProperty("UIClass", "Label3");
}

UIFooter::~UIFooter()
{
}

void UIFooter::setQCGeometry(int x, int y, int w, int h)
{
	this->setGeometry(x, y, w, h);

	int marginX = MARGIN_LEFT;

	m_pLabelCompany->adjustSize();
	QSize sizeCompany = m_pLabelCompany->size();
	m_pLabelCompany->move(marginX, (h - sizeCompany.height()) / 2);

	m_pLabelHotLine->adjustSize();
	QSize sizeHotLine = m_pLabelHotLine->size();
	m_pLabelHotLine->move(marginX + sizeCompany.width() + 100, (h - sizeHotLine.height()) / 2);
}

void UIFooter::initContent()
{
	m_pLabelCompany->setText(Company);
	m_pLabelHotLine->setText(HotLine);
}
